<template>
	<div id="app">
		<keep-alive><router-view v-if="$route.meta.keepAlive" /></keep-alive>
		<router-view v-if="!$route.meta.keepAlive" />
		<vue-ins-progress-bar></vue-ins-progress-bar>
	</div>
</template>
<script>
export default {
	provide() {
		return {
			viewHeight: this.getClientHeight
		};
	},
	data() {
		return {};
	},
	created() {
		this.$insProgress.start();
		this.$router.beforeEach((to, from, next) => {
			this.$insProgress.start();
			next();
		});
		this.$router.afterEach((to, from) => {
			this.$insProgress.finish();
		});
	},
	mounted() {
		this.$insProgress.finish();
	},
	methods: {
		getClientHeight() {
			let height = document.documentElement.clientHeight;
			return height;
		}
	}
};
</script>
<style lang="scss">
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color: #2c3e50;
	height: 100%;
	background-color: #f9f9f9;
	font-family: 'Microsoft YaHei', '微软雅黑';
}
</style>
